// 票务

import request from "@/utils/request_ticket.js";

/**
 * 电费查询
 * @param data number 电卡号
 */
const electricQuery = (data) =>  {
	return request.post("electric/Query", data, {
		noAuth: true,
		noVerify: true
	});
}

/**
 * 面额查询
 */
const electricDenomination = () =>  {
	return request.post("Electric/Denomination", {}, {
		noAuth: true
	});
}
// 火车票 start
/**
 * 查询余票
 */
const fetchTrainTicketInfo = (data) => {
	return request.post('Train/Query', data, {
		noAuth: true
	})
}
/**
 * 查询车次详情
 */
export const fetchTrainTicketNoDetail = (data) => {
	return request.post('Train/TrainNo', data, {
		noAuth: true
	})
}
/**
 * 获取火车城市列表
 */
const fetchTrainStation = (data) => {
	return request.post("Train/Station", data, {
		noAuth: true,
	});
}


// 火车票 end

/**
 * 提交订单
 */
const electricOrder = (data) =>  {
	return request.post("Electric/Order", data, {
	});
}

/**
 * 订单结果查询（废弃）
 */
const paySuccessStatus = (data) =>  {
	return request.post("Electric/PaySuccess", data, {
		noAuth: true
	});
}

/**
 * 违章单号查询
 */
const violationQuery = (data) =>  {
	return request.post("Violation/Query", data, {
		noAuth: true,
		noVerify: true
	});
}

/**
 * 提交违章订单支付
 */
const violationOrder = (data) =>  {
	return request.post("Violation/Order", data, {
	});
}

/**
 * 提交违章订单结果查询（废弃）
 */
const payViolationStatus = (data) =>  {
	return request.post("Violation/PaySuccess", data, {
		noAuth: true
	});
}

/**
 * 手机号信息查询
 */
const telephoneQuery = (data) =>  {
	return request.post("Telephone/Query", data, {
		noAuth: true,
		noVerify: true
	});
}

/**
 * 话费面额
 */
const telephoneDenomination = (data) =>  {
	return request.post("Telephone/Denomination", data, {
		noAuth: true,
	});
}

/**
 * 流量面额
 */
const teleflowDenomination = (data) =>  {
	return request.post("Teleflow/Denomination", data, {
		noAuth: true,
		noVerify: true
	});
}

/**
 * 话费充值
 */
const telephoneOrder = (data) =>  {
	return request.post("Telephone/Order", data, {
	});
}

/**
 * 话费支付成功回调（废弃）
 */
const telephonePaySuccess = (data) =>  {
	return request.post("Telephone/PaySuccess", data, {
		noAuth: true,
	});
}

/**
 * 流量充值
 */
const teleflowOrder = (data) =>  {
	return request.post("Teleflow/Order", data, {
	});
}

/**
 * 流量支付成功回调（废弃）
 */
const teleflowPaySuccess = (data) =>  {
	return request.post("Teleflow/PaySuccess", data, {
		noAuth: true,
	});
}
/**
 * 违章订单列表
 */
const fetchIllegalOrderList = (data) =>  {
	return request.post("Violation/OrderList", data, {
		noAuth: true,
	});
}
/**
 * 违章订单详情
 */
const fetchIllegalOrderInfo = (data) =>  {
	return request.post("Violation/OrderDetails", data, {
		noAuth: true,
	});
}
/**
 * 删除违章订单
 */
const deleteIllegalOrder = (data) =>  {
	return request.post("Violation/OrderDelete", data, {
		noAuth: true,
	});
}
/**
 * 电费订单列表
 */
const fetchElectricityOrderList = (data) =>  {
	return request.post("Electric/OrderList", data, {
		noAuth: true,
	});
}
/**
 * 电费订单详情
 */
const fetchElectricityOrderInfo = (data) =>  {
	return request.post("Electric/OrderDetails", data, {
		noAuth: true,
	});
}
/**
 * 删除电费订单
 */
const deleteElectricityOrder = (data) =>  {
	return request.post("Electric/OrderDelete", data, {
		noAuth: true,
	});
}
/**
 * 话费订单列表
 */
const fetchTelephoneChargesOrderList = (data) =>  {
	return request.post("Telephone/OrderList", data, {
		noAuth: true,
	});
}
/**
 * 话费订单详情
 */
const fetchTelephoneChargesOrderInfo = (data) =>  {
	return request.post("Telephone/OrderDetails", data, {
		noAuth: true,
	});
}
/**
 * 删除话费订单
 */
const deleteTelephoneChargesOrder = (data) =>  {
	return request.post("Telephone/OrderDelete", data, {
		noAuth: true,
	});
}

/**
 * 流量订单列表
 */
const fetchTrafficOrderList = (data) =>  {
	return request.post("Teleflow/OrderList", data, {
		noAuth: true,
	});
}
/**
 * 流量订单详情
 */
const fetchTrafficOrderInfo = (data) =>  {
	return request.post("Teleflow/OrderDetails", data, {
		noAuth: true,
	});
}
/**
 * 删除流量订单
 */
const deleteTrafficOrder = (data) =>  {
	return request.post("Teleflow/OrderDelete", data, {
		noAuth: true,
	});
}


/**
 * 乘车人列表
 */
const planePassengers = (data) =>  {
	return request.post("Plane/Passengers", data, {
		noAuth: true,
	});
}


/**
 * 违章订单状态
 */
const violationOrderStatus = (data) =>  {
	return request.post("Violation/OrderStatus", data, {
		noVerify: true
	});
}

/**
 * 电费订单状态
 */
const electricOrderStatus = (data) =>  {
	return request.post("Electric/OrderStatus", data, {
		noVerify: true
	});
}

/**
 * 话费订单状态
 */
const telephoneOrderStatus = (data) =>  {
	return request.post("Telephone/OrderStatus", data, {
		noVerify: true
	});
}

/**
 * 流量订单状态
 */
const teleflowOrderStatus = (data) =>  {
	return request.post("Teleflow/OrderStatus", data, {
		noVerify: true
	});
}

/**
 * 电费重新支付
 */
const electricPayAgain = (data) =>  {
	return request.post("Electric/PayAgain", data, {});
}

/**
 * 电费取消支付
 */
const electricPayCancel = (data) =>  {
	return request.post("Electric/PayCancel", data, {});
}


/**
 * 违章重新支付
 */
const violationPayAgain = (data) =>  {
	return request.post("Violation/PayAgain", data, {});
}

/**
 * 违章取消支付
 */
const violationPayCancel = (data) =>  {
	return request.post("Violation/PayCancel", data, {});
}

/**
 * 话费重新支付
 */
const telephonePayAgain = (data) =>  {
	return request.post("Telephone/PayAgain", data, {});
}

/**
 * 话费取消支付
 */
const telephonePayCancel = (data) =>  {
	return request.post("Telephone/PayCancel", data, {});
}

/**
 * 流量重新支付
 */
const teleflowPayAgain = (data) =>  {
	return request.post("Teleflow/PayAgain", data, {});
}

/**
 * 流量取消支付
 */
const teleflowPayCancel = (data) =>  {
	return request.post("Teleflow/PayCancel", data, {});
}

/**
 * 获取海报
 */
const userSpreadPoster = () =>  {
	return request.post("User/SpreadPoster", {}, {});
}

/**
 * 推广绑定
 * code 推广编号
 */
const userSpread = (data) =>  {
	return request.post("User/Spread", data, {
		noVerify: true
	});
}

/**
 * 我推广的成员
 * page 页码
 */
const userSpreadPeople = (data) =>  {
	return request.post("User/SpreadPeople", data, {});
}

/**
 * 我的收入
 * page 页码
 */
const userSpreadIncome = (data) =>  {
	return request.post("User/SpreadIncome", data, {});
}

/**
 * 我的钱包
 * page 页码
 */
const userWallet = (data) =>  {
	return request.post("User/Wallet", data, {});
}

/**
 * 提现
 */
const userWithdrawal = () =>  {
	return request.post("User/Withdrawal", {}, {
		noVerify: true
	});
}

/**
 * 代理中心获取用户信息
 */
const userAgencyCenter = () =>  {
	return request.post("User/AgencyCenter", {}, {});
}

/**
 * 开通代理
 */
const userOpenAgent = (data) =>  {
	return request.post("User/OpenAgent", data, {});
}

/**
 * 代理取消支付
 */
const serOpenPayCancel = (data) =>  {
	return request.post("User/OpenPayCancel", data, {});
}

/**
 * 代理重新支付
 */
const userOpenPayAgain = (data) =>  {
	return request.post("User/OpenPayAgain", data, {});
}


/**
 * 新加的接口
 */
// 身份证识别
export function getIdInfo() {
	return {

	}
}

// 火车乘客列表
export function getTrainPassengers(data) {
	return request.post("Train/Passengers", data, {});
}
// 火车乘客配置
export function getTrainPassengersConfig(data) {
	return request.post("Train/PassengersConfig", data, {});
}
// 添加火车乘车人
export const trainPassengersAdd = (data) =>  {
	return request.post("Train/PassengersAdd", data);
}
// 乘客详情
export const trainPassengersDetail = (data) =>  {
	return request.post("Train/PassengersDetails", data);
}
//修改火车乘车人
export const trainPassengersUpdate = (data) =>  {
	return request.post("Train/PassengersUpdate", data);
}

// 删除火车乘车人
export const trainPassengersDel = (data) =>  {
    return request.post("Train/PassengersDelete", data);
}
// 提交订单
export const submitTrainOrder = (data) => {
	return request.post('Train/Order', data)
}
// 重新发起订单
export const submitTrainOrderAgain = (data) => {
	return request.post('Train/PayAgain', data, {
	})
}
// 订单详情
export const getTrainOrderDetail = (data) => {
	return request.post('Train/OrderDetails', data, {
		noAuth: true,
		noVerify: true
	})
}
// 订单列表
export const getTrainOrderList = (data) => {
	return request.post('Train/OrderList', data, {
		noAuth: true,
		noVerify: true
	})
}

// 删除订单
export const deleteTrainOrder = (data) => {
	return request.post('Train/OrderDelete', data, {
		noAuth: true,
		noVerify: true
	})
}
// 取消订单
export const cancelTrainOrder = (data) => {
	return request.post('Train/OrderCancel', data, {
		noAuth: true,
		noVerify: true
	})
}
// 取消支付
export const cancelTrainOrderPay = (data) => {
	return request.post('Train/PayCancel', data, {
		noAuth: true,
		noVerify: true
	})
}
/**
 * 机票
 */
// 获取机场城市列表
export const fetchAirPortStation = (data) => {
    return request.post("Plane/AirPort", data, {
        noAuth: true,
    });
}
// 获取航班
export const fetchAirPortFlights = (data) => {
    return request.post("Plane/Flights", data, {
        noAuth: true,
    });
}
// 获取航班仓位 /Api/Plane/Cabins
export const fetchAirPortCabins = (data) => {
    return request.post("Plane/Cabins", data, {
        noAuth: true,
    });
}
// 乘客列表
export function getPlanePassengers(data) {
    return request.post("Plane/Passengers", data, {});
}
// 乘客配置
export function getPlanePassengersConfig(data) {
    return request.post("Plane/PassengersConfig", data, {});
}
// 飞机乘车人
export const planePassengersAdd = (data) =>  {
    return request.post("Plane/PassengersAdd", data, {
        noAuth: true,
    });
}
// 删除乘车人
export const planePassengersDel = (data) =>  {
    return request.post("Plane/PassengersDelete", data, {
        noAuth: true,
    });
}
// 乘客详情
export const planePassengersDetail = (data) =>  {
    return request.post("Plane/PassengersDetails", data, {
        noAuth: true,
    });
}
//修改飞机乘车人
export const planePassengersUpdate = (data) =>  {
	return request.post("Plane/PassengersUpdate", data);
}
// 提交订单
export const submitPlanOrder = (data) => {
    return request.post('Plane/Order', data, {
    })
}
// 重新发起订单
export const submitPlanOrderAgain = (data) => {
    return request.post('Plane/PayAgain', data, {
    })
}
// 取消支付
export const cancelPlanOrderPay = (data) => {
    return request.post('Plane/PayCancel', data, {
        noAuth: true,
        noVerify: true
    })
}

// 订单详情
export const getPlanOrderDetail = (data) => {
	return request.post('Plane/OrderDetails', data, {
		noAuth: true,
		noVerify: true
	})
}
// 订单列表
export const getPlanOrderList = (data) => {
	return request.post('Plane/OrderList', data, {
		noAuth: true,
		noVerify: true
	})
}
// 删除订单
export const deletePlanOrder = (data) => {
	return request.post('Plane/OrderDelete', data, {
		noAuth: true,
		noVerify: true
	})
}

// 取消订单
export const cancelPlanOrder = (data) => {
	return request.post('Plan/OrderCancel', data, {
		noAuth: true,
		noVerify: true
	})
}

export {
	electricQuery,
	electricDenomination,
	electricOrder,
	paySuccessStatus,
	violationQuery,
	violationOrder,
	payViolationStatus,
	telephoneQuery,
	telephoneDenomination,
	teleflowDenomination,
	fetchTrainTicketInfo,
	telephoneOrder,
	telephonePaySuccess,
	teleflowPaySuccess,
	planePassengers,
	violationOrderStatus,
	electricOrderStatus,
	telephoneOrderStatus,
	teleflowOrder,
	fetchIllegalOrderList,
	fetchIllegalOrderInfo,
	deleteIllegalOrder,
	fetchElectricityOrderList,
	fetchElectricityOrderInfo,
	deleteElectricityOrder,
	fetchTelephoneChargesOrderList,
	fetchTelephoneChargesOrderInfo,
	deleteTelephoneChargesOrder,
	fetchTrafficOrderList,
	fetchTrafficOrderInfo,
	deleteTrafficOrder,
	teleflowOrderStatus,
	fetchTrainStation,
	electricPayAgain,
	electricPayCancel,
	violationPayAgain,
	violationPayCancel,
	telephonePayAgain,
	telephonePayCancel,
	teleflowPayAgain,
	teleflowPayCancel,
	userSpreadPoster,
	userSpread,
	userSpreadPeople,
	userSpreadIncome,
	userWallet,
	userWithdrawal,
	userAgencyCenter,
	userOpenAgent,
	serOpenPayCancel,
	userOpenPayAgain
}
